<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        window.onload = function (){
            alert(222);
        }
        function add(){
            $('bigDiv').style.display = "block";
        }
        function $(id){
            return document.getElementById(id);
        }
    </script>

    <style>
        #bigDiv{
            background-color: rgba(255,0,0,0.5);
            position: absolute;
            top:0px;
            left:0px;
            width: 500px;
            height: 500px;
            display: none;
        }
    </style>
</head>
<body>
    2.html
    <div id="mydiv"></div>
    <input type="button" value="添加" onclick="add()">

    <div id="bigDiv"></div>
</body>
</html>